<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="layui/css/layui.css">
<script type="text/javascript" src="layui/layui.js"></script>
</head>
<body>

	
		<form lay-filter="f_m" id="my_fm" class="layui-form" action="">
			<input type="checkbox" id="aaa" name="zzz" lay-skin="switch" lay-text="开启|关闭">	
		</form>

	
	<script>
		layui.use(['table','layer','form'], function(){
		  var table = layui.table;
		  var layer = layui.layer;
		  var form = layui.form;
		  var $ = layui.$;
		  console.log($("#aaa").is(":checked") ? "开启" : "关闭");
		  let yesOrNo=$("#aaa").is(":checked") ? "开启" : "关闭";
		 	
		 		console.log(yesOrNo);
		 		});
	</script>
</body>
</html>